package com.alibaba.algo.cooperation.usercomponent.service.user;

import com.alibaba.algo.cooperation.common.BaseResult;
import com.alibaba.algo.cooperation.usercomponent.vo.req.user.ResourceActionRequestVO;
import com.alibaba.algo.cooperation.usercomponent.vo.req.user.ResourceRequestVO;
import com.alibaba.algo.cooperation.usercomponent.vo.req.user.SelectResourceListRequestVO;
import com.alibaba.algo.cooperation.usercomponent.vo.req.xml.ImportParam;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;

/**
 * 类SysResourceService.java的实现描述：资源 service
 *
 * @author nieganggang 2021-03-12 16:08:17
 */
//不兼容现有资源模型，弃用
public interface SysResourceService {

    @RequestMapping(value = "/sysResource/selectPage", method = RequestMethod.POST)
    BaseResult selectPage(@RequestBody SelectResourceListRequestVO selectResourceListRequestVO);


    @RequestMapping(value = "/sysResource/selectResourceAction", method = RequestMethod.POST)
    BaseResult selectResourceAction(@RequestParam(name = "resourceId") Long resourceId, @RequestParam(name = "appCode") String appCode);

    @RequestMapping(value = "/sysResource/updateResourceAction", method = RequestMethod.POST)
    BaseResult updateResourceAction(@RequestBody ResourceActionRequestVO vo);

    @RequestMapping(value = "/sysResource/removeResourceAction", method = RequestMethod.POST)
    BaseResult removeResourceAction(@RequestBody ResourceActionRequestVO vo);

    @RequestMapping(value = "/sysResource/removeResource", method = RequestMethod.POST)
    BaseResult removeResource(@RequestBody ResourceRequestVO vo);

    /**
     * 菜单导出
     *
     * @param param 菜单ids
     * @return true/false
     */
    @RequestMapping(value = "/sysResource/export", method = RequestMethod.POST)
    void resourceExport(HttpServletResponse response, @RequestBody ImportParam param);

    /**
     * 菜单导入
     *
     * @param file 菜单文件xml
     * @return stream
     */
    @RequestMapping(value = "/sysResource/import", method = RequestMethod.POST)
    BaseResult resourceImport(@RequestBody MultipartFile file, @RequestParam("appCode") String appCode);

}
